home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / xdsn217.zip / DOC / isom2.inf (.txt) < prev    next >
OS/2 Help File  |  1996-07-07  |  41KB  |  1,226 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Disclaimer ΓòÉΓòÉΓòÉ
  3.  
  4. This on-line document was generated automatically from its printed version 
  5. LaTeX source. Some places in the document (especially tables) may look ugly due 
  6. to the conversion program limits. These problems are being worked on and are 
  7. supposed to be solved in the final release. 
  8.  
  9.  
  10. ΓòÉΓòÉΓòÉ 2. Title Page ΓòÉΓòÉΓòÉ
  11.  
  12.  xTech Development System 
  13.  
  14.  ISO Modula-2 Language Reference 
  15.  
  16.  xTech Ltd, 1996 
  17.  
  18. XDS software and documentation copyright (c) 1991-1996 xTech Ltd. (xTech). 
  19.  
  20. Information in this document is subject to change without notice and does not 
  21. represent a commitment on the part of xTech. 
  22.  
  23. All rights reserved. You may use the enclosed software on a single computer; 
  24. transfer the software from one computer to another, provided that the software 
  25. is used on only one computer at a time and that you remove any copies of the 
  26. software on the computer from which the copies were made; make copies of the 
  27. software for backup purposes only. 
  28.  
  29. XDS software and documentation have been tested and reviewed. Nevertheless, 
  30. xTech makes no warranty or representation, either express or implied, with 
  31. respect to the software and documentation included with XDS. In no event will 
  32. xTech be liable for direct, indirect, special, incidental or consequential 
  33. damages resulting from any defect in the software or documentation included 
  34. with this product. In particular, xTech shall have no liability for any 
  35. programs or data used with this product, including the cost of recovering 
  36. programs or data. 
  37.  
  38. XDS is a trademark of xTech Ltd. 
  39.  
  40. All trademarks and copyrights mentioned in this documentation are the property 
  41. of their respective holders. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 3. Introduction ΓòÉΓòÉΓòÉ
  45.  
  46. This document contains lexis and syntax definitions only. The full ISO Modula-2 
  47. Reference will be provided after we receive a copy of the recently published 
  48. ISO Modula-2 Standard. 
  49.  
  50.  
  51. ΓòÉΓòÉΓòÉ 4. The Lexis ΓòÉΓòÉΓòÉ
  52.  
  53. The Modula-2 Lexis is the specification of the lexical elements of Modula-2 
  54. source code including white space, comments, source code directives, and the 
  55. tokens that are used in the concrete syntax. All the symbols and pervasive 
  56. identifiers of Modula-2 are defined in this section. 
  57.  
  58.      Source Code Structure 
  59.      Word tokens 
  60.      Symbols and Operators 
  61.      Constant Literals 
  62.      Separators 
  63.      Letters and National Characters 
  64.  
  65.  
  66. ΓòÉΓòÉΓòÉ 4.1. Source Code Structure ΓòÉΓòÉΓòÉ
  67.  
  68. modula2 source code= { delimited token }, { separator } ; 
  69.  
  70. delimited token= { separator }, token ; 
  71.  
  72. token= word token | symbol | constant literal ; 
  73.  
  74. NOTE: A token is the largest sequence of characters that satisfies the 
  75. definitions. Consequently, a word token must be separated from a following word 
  76. token, numeric literal, string literal or character number literal. 
  77. Furthermore, a numeric literal must be separated from a following numeric 
  78. literal or character number literal. 
  79.  
  80.  
  81. ΓòÉΓòÉΓòÉ 4.2. Word tokens ΓòÉΓòÉΓòÉ
  82.  
  83. word token= identifier | keyword ; 
  84.  
  85.      Identifiers 
  86.      Portable Identifiers 
  87.      Full Identifiers 
  88.      Pervasive Identifiers 
  89.      Keywords 
  90.  
  91.  
  92. ΓòÉΓòÉΓòÉ 4.2.1. Identifiers ΓòÉΓòÉΓòÉ
  93.  
  94. identifier= portable identifier | full identifier | pervasive identifier ; 
  95.  
  96.  
  97. ΓòÉΓòÉΓòÉ 4.2.2. Portable Identifiers ΓòÉΓòÉΓòÉ
  98.  
  99. portable identifier= 
  100. ( simple letter | low line ), { simple alphanumeric | low line } ; 
  101.  
  102. low line= "_" ; 
  103.  
  104.  
  105. ΓòÉΓòÉΓòÉ 4.2.3. Full Identifiers ΓòÉΓòÉΓòÉ
  106.  
  107. full identifier= 
  108. ( national letter | low line ), { national alphanumeric | low line } ; 
  109.  
  110.  
  111. ΓòÉΓòÉΓòÉ 4.2.4. Pervasive Identifiers ΓòÉΓòÉΓòÉ
  112.  
  113. pervasive identifier= 
  114. "ABS" | "BITSET" | "BOOLEAN" | "CARDINAL" | 
  115. "CAP" | "CHR" | "CHAR" | "COMPLEX" | 
  116. "CMPLX" | "DEC" | "DISPOSE" | "EXCL" | 
  117. "FALSE" | "FLOAT" | "HALT" | "HIGH" | 
  118. "IM" | "INC" | "INCL" | "INT" | 
  119. "INTERRUPTIBLE" | "INTEGER" | "LENGTH" | "LFLOAT" | 
  120. "LONGCOMPLEX" | "LONGREAL" | "MAX" | "MIN" | 
  121. "NEW" | "NIL" | "ODD" | "ORD" | 
  122. "PROC" | "PROTECTION" | "RE" | "REAL" | 
  123. "SIZE" | "TRUE" | "TRUNC" | "UNINTERRUPTIBLE" | 
  124. "VAL" ; 
  125.  
  126. NOTE: Pervasive identifiers are not reserved words; if redeclared in a program, 
  127. they will no longer have their predefined meaning in the scope of the 
  128. redeclared identifier. 
  129.  
  130.  
  131. ΓòÉΓòÉΓòÉ 4.2.5. Keywords ΓòÉΓòÉΓòÉ
  132.  
  133. keyword= 
  134. "AND" | "ARRAY" | "BEGIN" | "BY" | 
  135. "CASE" | "CONST" | "DEFINITION" | "DIV" | 
  136. "DO" | "ELSE" | "ELSIF" | "END" | 
  137. "EXIT" | "EXCEPT" | "EXPORT" | "FINALLY" | 
  138. "FOR" | "FORWARD" | "FROM" | "IF" | 
  139. "IMPLEMENTATION" | "IMPORT" | "IN" | "LOOP" | 
  140. "MOD" | "MODULE" | "NOT" | "OF" | 
  141. "OR" | "PACKEDSET" | "POINTER" | "PROCEDURE" | 
  142. "QUALIFIED" | "RECORD" | "REM" | "RETRY" | 
  143. "REPEAT" | "RETURN" | "SET" | "THEN" | 
  144. "TO" | "TYPE" | "UNTIL" | "VAR" | 
  145. "WHILE" | "WITH" ; 
  146.  
  147. NOTE: The keywords AND, DIV, IN, MOD, NOT, OR and REM are operator keywords; 
  148. the rest are punctuation keywords. 
  149.  
  150.  
  151. ΓòÉΓòÉΓòÉ 4.3. Symbols and Operators ΓòÉΓòÉΓòÉ
  152.  
  153. symbol= required symbol | symbol with alternatives | operator ; 
  154.  
  155.      Required Symbols 
  156.      Symbols with alternatives 
  157.      Operators 
  158.  
  159.  
  160. ΓòÉΓòÉΓòÉ 4.3.1. Required Symbols ΓòÉΓòÉΓòÉ
  161.  
  162. required symbol= 
  163. colon | comma | ellipsis | equals | 
  164. period | semicolon | left parenthesis | right parenthesis ; 
  165.  
  166. colon= ":" ; 
  167.  
  168. comma= "," ; 
  169.  
  170. ellipsis= ".." ; 
  171.  
  172. equals= "=" ; 
  173.  
  174. period= "." ; 
  175.  
  176. semicolon= ";" ; 
  177.  
  178. left parenthesis= "(" ; 
  179.  
  180. right parenthesis= ")" ; 
  181.  
  182.  
  183. ΓòÉΓòÉΓòÉ 4.3.2. Symbols with alternatives ΓòÉΓòÉΓòÉ
  184.  
  185. symbol with alternatives= 
  186. left bracket | right bracket | left brace | right brace | case separator ; 
  187.  
  188. left bracket= preferred left bracket | required left bracket ; 
  189.  
  190. preferred left bracket= "[" ; 
  191.  
  192. required left bracket= "(!" ; 
  193.  
  194. right bracket= preferred right bracket | required right bracket ; 
  195.  
  196. preferred right bracket= "]" ; 
  197.  
  198. required right bracket= "!)" ; 
  199.  
  200. left brace= preferred left brace | required left brace ; 
  201.  
  202. preferred left brace= "" ; 
  203.  
  204. required left brace= "(:" ; 
  205.  
  206. right brace= preferred right brace | required right brace ; 
  207.  
  208. preferred right brace= "" ; 
  209.  
  210. required right brace= ":)" ; 
  211.  
  212. case separator= preferred case separator | required case separator ; 
  213.  
  214. preferred case separator= "|" ; 
  215.  
  216. required case separator= "!" ; 
  217.  
  218.  
  219. ΓòÉΓòÉΓòÉ 4.3.3. Operators ΓòÉΓòÉΓòÉ
  220.  
  221. operator= 
  222. assignment operator | plus operator | set union operator | 
  223. string catenate symbol | minus operator | set difference operator | 
  224. logical disjunction operator | multiplication operator | division operator | 
  225. div operator | mod operator | rem operator | 
  226. set intersection operator | symmetric set difference operator | 
  227. logical conjunction operator | sign | logical negation operator | equals 
  228. operator | 
  229. inequality operator | less than operator | greater than operator | 
  230. less than or equal operator | greater than or equal operator | subset operator 
  231. superset operator | set membership operator | dereferencing operator ; 
  232.  
  233. assignment operator= ":=" ; 
  234.  
  235. plus operator= "+" ; 
  236.  
  237. set union operator= "+" ; 
  238.  
  239. string catenate symbol= "+" ; 
  240.  
  241. minus operator= "-" ; 
  242.  
  243. set difference operator= "-" ; 
  244.  
  245. logical disjunction operator= "OR" ; 
  246.  
  247. multiplication operator= "*" ; 
  248.  
  249. division operator= "/" ; 
  250.  
  251. div operator= "DIV" ; 
  252.  
  253. mod operator= "MOD" ; 
  254.  
  255. rem operator= "REM" ; 
  256.  
  257. set intersection operator= "*" ; 
  258.  
  259. symmetric set difference operator= "/" ; 
  260.  
  261. logical conjunction operator= and keyword | and synonym ; 
  262.  
  263. and keyword= "AND" ; 
  264.  
  265. and synonym= "&" ; 
  266.  
  267. sign= identity operator | arithmetic negation operator ; 
  268.  
  269. identity operator= "+" ; 
  270.  
  271. arithmetic negation operator= "-" ; 
  272.  
  273. logical negation operator= not keyword | not synonym ; 
  274.  
  275. not keyword= "NOT" ; 
  276.  
  277. not synonym= "" ; 
  278.  
  279. equals operator= "=" ; 
  280.  
  281. inequality operator= not equals operator | not equals synonym ; 
  282.  
  283. not equals operator= "<>" ; 
  284.  
  285. not equals synonym= "#" ; 
  286.  
  287. less than operator= "<" ; 
  288.  
  289. greater than operator= ">" ; 
  290.  
  291. less than or equal operator= "<=" ; 
  292.  
  293. greater than or equal operator= ">=" ; 
  294.  
  295. subset operator= "<=" ; 
  296.  
  297. superset